import Vue from 'vue'
import App from './App.vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)
Vue.config.productionTip = false

// 一级路由
import UI_Router from './One/UI_Router.vue'
import Contacts from './One/Contacts.vue'
import About from './One/About.vue'

// 二级路由
import All_contacts from './One/Two/All_contacts.vue'
import Alice from './One/Two/Alice.vue'
import Bob from './One/Two/Bob.vue'
// 三级路由
import A from './One/Two/Three/a.vue'
import B from './One/Two/Three/b.vue'



const routes = [
  {
    path: '/',
    redirect: '/ui',
  },
  {
    path: '/ui',
    component: UI_Router,
  },
  {
    path: '/contacts',
    component: Contacts,
    children: [
      {
        path: 'all_contacts',
        component: All_contacts,

      },
      {
        path: 'alice',
        component: Alice,
      },
      {
        path: 'bob',
        component: Bob,
        children: [
          {
            path: 'a',
            component: A,
          },
          {
            path: 'b',
            component: B,
          },

        ]
      }
    ]
  },
  {
    path: '/about',
    component: About,
  },
]

const router = new VueRouter({
  routes
})

new Vue({
  router,
  render: h => h(App),
}).$mount('#app')
